using System;

namespace Datacollection.Services.Logging
{
    /// <summary>
    /// 日志服务接口
    /// </summary>
    public interface ILoggerService
    {
        /// <summary>
        /// 日志事件，当有新日志时触发
        /// </summary>
        event Action<string> LogEvent;

        /// <summary>
        /// 调试级别日志
        /// </summary>
        /// <param name="message">日志消息</param>
        void Debug(string message);

        /// <summary>
        /// 信息级别日志
        /// </summary>
        /// <param name="message">日志消息</param>
        void Info(string message);

        /// <summary>
        /// 警告级别日志
        /// </summary>
        /// <param name="message">日志消息</param>
        void Warn(string message);

        /// <summary>
        /// 错误级别日志
        /// </summary>
        /// <param name="message">日志消息</param>
        /// <param name="ex">异常对象</param>
        void Error(string message, Exception ex = null);

        /// <summary>
        /// 致命错误级别日志
        /// </summary>
        /// <param name="message">日志消息</param>
        /// <param name="ex">异常对象</param>
        void Fatal(string message, Exception ex = null);
    }
}
    